<% if @search_term.empty? %>
  <h1>You can't search for nothing...</h1>
<% else %>
  <h1>
    Search results for 
    <%=h @search_string %>
  </h1>
<% end %>

<% if !@search_term.blank? %>

  <h3>Artists matching that name:</h3>

  <% if !@artists.empty? %>
    <% @artists.each do |artist| %>
      <%= link_to artist.name, artist_path(artist) %>
      <br />
    <% end %>
  <% end %>

  <br />
  Create an artist entry for <%=h @search_string %> 
  <%= link_to 'Create', new_artist_path(:name => @search_string) %>
  <hr />

  <h3>Releases matching that name:</h3>

  <% if !@releases.empty? %>
    <% @releases.each do |release| %>
      <%= link_to release.title, release_edition_path(release, release.editions.first) %>
      <br />
    <% end %>
  <% end %>

  <br />
  Create a release entry for <%=h @search_string %>
  <%= link_to 'Create', new_release_path(:title => @search_string) %>
  <hr />

  <h3>Songs matching that name:</h3>

  <% if !@songs.empty? %>
    <% @songs.each do |song| %>
      <%= link_to song.title, song_path(song) %>
      <br />
    <% end %>
  <% end %>

  <br />
  Create a song entry for <%=h @search_string %>
  <%= link_to 'Create', new_song_path(:title => @search_string) %>
  <hr />

  <h3>Labels matching that name:</h3>
  
  <% if !@labels.empty? %>
    <% @labels.each do |label| %>
      <%= link_to label.name, label_path(label) %>
      <br />
    <% end %>
  <% end %>

  <br />
  Create a label entry for <%=h @search_string %>
  <%= link_to 'Create', new_label_path(:name => @search_string) %>
  <hr />
  
  <h3>Genres matching that name:</h3>

  <% if !@genres.empty? %>
    <% @genres.each do |genre| %>
      <%= link_to genre.name, genre_path(genre) %>
      <br />
    <% end %>
  <% end %>

  <br />
  Create a genre entry for <%=h @search_string %>
  <%= link_to 'Create', new_genre_path(:name => @search_string) %>
  <hr />

<% end %>
